package com.cmwa.solution.business.myHome.todo.service;

import java.util.List;

import javax.annotation.Resource;

import com.cmwa.solution.business.myHome.todo.dao.TodoBizRelDao;
import com.cmwa.solution.business.myHome.todo.entity.TodoBizRelVo;
import com.cmwa.solution.business.myHome.todo.entity.TodoVo;
import com.cmwa.solution.business.myHome.todo.enums.ServiceType;
import com.cmwa.solution.business.myHome.todo.enums.TodoBizType;
import com.cmwa.solution.utils.Constant;
import com.cmwa.solution.utils.SessionUtils;

public abstract class AbsTodoBizRelGenerator implements TodoBizRelGenerator {

	public ServiceType serviceTypes;
	@Resource
	protected TodoBizRelDao todoBizRelDao;

	public ServiceType getServiceTypes() {
		return serviceTypes;
	}

	public void setServiceTypes(ServiceType serviceTypes) {
		this.serviceTypes = serviceTypes;
	}

	@Override
	public void batchSaveTodoBizRel(List<TodoBizRelVo> bizRelVos) {
		
	}

	@Override
	public void saveTodoBizRel(TodoBizRelVo relVo) {
		todoBizRelDao.add(relVo);
	}

	public TodoBizRelVo buildRelVo(TodoVo todoVo, TodoBizType bizType, String bizId) {
		TodoBizRelVo relVo = new TodoBizRelVo();
		relVo.setTodoId(todoVo.getId());
		relVo.setBizType(bizType);
		relVo.setBizId(bizId);
		relVo.setStatus(Constant.C_STATUS_C);
		relVo.setCreateId(SessionUtils.getEmployee().getID());
		return relVo;
	}
	
}
